﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Singleton</title>
    <script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="Scripts/Singleton.js" type="text/javascript"></script>
    <script type="text/javascript">
        //Singleton A test;
        singleton_A.log("1..2..3... mic test");

        //Singleton_B test;
        function NonSingleton() { }
        NonSingleton.prototype =
        {
            consturctor: NonSingleton,
            scream: function(){console.log("Woooohoooooo!")}
        }

        var singleton1 = new Singleton_B();
        var singleton2 = $.extend( {}, singleton1 );
        var singleton3 = $.extend( true, {}, singleton1 );

        singleton1.log( "singleton 1 " );
        singleton2.log( "singleton 2 " );
        singleton3.log( "singleton 2 " );
        singleton1.log( "singleton 1 " );
        var nonsingleton = new NonSingleton();
        
        console.log( singleton1._a );
        singleton1.log("3..2..1... ignition!");
        nonsingleton.scream();


    </script>
</head>
<body>

</body>
</html>
